import RescacheMgr from "../framework/inc/rescachemgr";
import ViewBase from "./viewbase";
import StagerMgr from "./../framework/inc/stagemgr";
import PhyWorld from "./fight/phyworld";
// import { TweenMax } from "gsap";

export default class ViewStart extends ViewBase {
    constructor(sfile) {
        super("viewstart");
        this._res_mgr = RescacheMgr.getInstance();

        this.initGraph();
        // this.runAction();
    }

    initGraph() {
        let button = d.button("#ui_logo", "ui_logo").pos(d.w /2 , d.h / 2 + 10);
        button.setTap(()=>{
            StagerMgr.getInstance().clearView();
            PhyWorld.getWorld().startRunning();
        })
        this.add(button);


        let layer = d.layer(new THREE.Color(0xff0000), 100, 100).pos(d.w / 2, d.h / 2 + 100);
        console.log("new layer");
        this.add(layer);

        let sp = d.sp("#ui_logo", "ui_logo").pos(d.w /2 , d.h / 2);
        sp.alignLB();
        this.add(sp);
    }

    runAction() {
        // TweenMax.to
        //     (
        //         this._sp.scale,
        //         1,
        //         {
        //             x: 1.5,
        //             y: 1.5,
        //             z: 1.5,
        //             repeat: -1,
        //             yoyo: true
        //         },

        //     )
    }
}